/*
 * setheadcrc16.cc
 *
 *  Created on: 2011-1-6
 *      Author: xuhui
 */

#include <click/config.h>
#include "crc.h"
#include "setheadcrc16.hh"

SetHeadCRC16::SetHeadCRC16(){

}

SetHeadCRC16::~SetHeadCRC16(){

}

Packet *
SetHeadCRC16::simple_action(Packet *p){
	unsigned short crc = 0xffff;
	crc = update_crc16(crc, (char *) p->data(), sizeof(struct click_wifi));
	memcpy(p->data() + sizeof(struct click_wifi), &crc, 2);
	return p;
}

CLICK_ENDDECLS
EXPORT_ELEMENT(SetHeadCRC16)
